//
//  L2Tab6.m
//  Lesson2
//
//  Created by Alexander Trifonov on 20.04.12.
//  Copyright (c) 2012 fgengine@gmail.com. All rights reserved.
//

#import "L2Tab6.h"

@implementation L2Tab6

- (IBAction) imagePan:(UIPanGestureRecognizer*)recognizer
{
    CGPoint translation = [recognizer translationInView:self.view];
    recognizer.view.center = CGPointMake(
                                            recognizer.view.center.x + translation.x, 
                                            recognizer.view.center.y + translation.y
                                        );
    [recognizer setTranslation:CGPointMake(0, 0) inView:self.view];
}

- (IBAction) imagePinch:(UIPinchGestureRecognizer*)recognizer
{
    
    recognizer.view.transform = CGAffineTransformScale(recognizer.view.transform, recognizer.scale, recognizer.scale);
    recognizer.scale = 1;
    
}

- (IBAction) imageRotate:(UIRotationGestureRecognizer*)recognizer
{
    
    recognizer.view.transform = CGAffineTransformRotate(recognizer.view.transform, recognizer.rotation);
    recognizer.rotation = 0;
    
}

@end
